﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Heavy_Metals
{
    public partial class LYXX_DMJC_FX : Form
    {
        public LYXX_DMJC_FX()
        {
            InitializeComponent();
        }

        public DrawCurves dc = new DrawCurves();
        private void LYXX_DMJC_FX_Load(object sender, EventArgs e)
        {

        }

        private void LYXX_DMJC_FX_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            Pen p = new Pen(Color.Blue, 2);
            dc.DrawCoordinate(g, p, 100, 200, 400, 180, 20, 20, 2.5, 5.0);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (this.listBox1.SelectedIndex != -1)
            {
                this.listBox2.Items.Add(this.listBox1.SelectedItem.ToString());
                this.listBox1.Items.RemoveAt(this.listBox1.SelectedIndex);
            }

        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (this.listBox2.SelectedIndex != -1)
            {
                this.listBox1.Items.Add(this.listBox2.SelectedItem.ToString());
                this.listBox2.Items.RemoveAt(this.listBox2.SelectedIndex);
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            int count = this.listBox1.Items.Count;
            int i = 0;
            for (i = 0; i < count; i++)
            {
                this.listBox2.Items.Add(this.listBox1.Items[i].ToString());
            }
            this.listBox1.Items.Clear();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            int count = this.listBox2.Items.Count;
            int i = 0;
            for (i = 0; i < count; i++)
            {
                this.listBox1.Items.Add(this.listBox2.Items[i].ToString());
            }
            this.listBox2.Items.Clear();
        }

        private void button5_Click(object sender, EventArgs e)
        {
            Graphics g = this.CreateGraphics();
            Pen p = new Pen(Color.Blue, 2);
            MessageBox.Show("预测成功", "操作提示");
            double perPicelY = 5.0 / 20;
            double[] data = { 10, 7, 6,12, 8, 11, 10, 6 ,9,10,8,11,9,8,11,12,10};
            dc.DrawCurve(g, p, "砷", new Point(30, 50), 100, 200, perPicelY, 20, data);
        }
    }
}
